// 输入时间戳，返回时间---2020/11/11 10:15:13----
function timehandle(val, num) {
  let str = val.toString();
  if (str.length <= 12) {
    str += "000";
  }
  // console.log("val2",str)
  str = parseInt(str);

  let date = new Date(str);
  let year = date.getFullYear();
  let month = date.getMonth() + 1;
  let day = date.getDate();
  let hour = date.getHours();
  let minu = date.getMinutes();
  let miao = date.getSeconds();


  if (!Boolean(num)) {
    let timee = `${year}/${month}/${day} ${hour}:${minu}:${miao}`;
    // console.log("timee",timee)
    return timee;
  } else if(num === "2" ){

    return `${year}/${month}/${day}`;

  }
}

export default timehandle;
